package cn.zswltech.gruul.api;

import cn.zswltech.gruul.common.dto.*;
import cn.zswltech.gruul.common.entity.FunctionDO;
import cn.zswltech.gruul.common.entity.MenuDO;
import cn.zswltech.gruul.common.result.Response;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Jim
 * @version 1.0.0
 * @descripition:
 * @date 2024/1/29 13:38
 */
// @FeignClient(value = "gruul",path = "/regedit")
@RequestMapping("regedit")
public interface MenuApi {

    /**
     * 根据menuCode查询功能列表
     *
     * @return
     * @throws Exception
     */
    @GetMapping("function")
    Response<List<FunctionDO>> queryByMenuId();

    /**
     * 删除功能
     *
     * @param id
     * @return
     * @throws Exception
     */
    @DeleteMapping("/function")
    Response deleteFunction(Long id);

    /**
     * 更新功能
     *
     * @return
     * @throws Exception
     */
    @PutMapping("function")
    Response updateFunction();

    /**
     * 创建功能
     *
     * @return
     * @throws Exception
     */
    @PostMapping("function")
    Response createFunction();

    /**
     * 获取全部菜单
     *
     * @throws Exception
     * @returnx
     */
    @GetMapping("menu")
    Response<List<MenuDO>> getMenuList();

    /**
     * 创建菜单
     *
     * @return
     * @throws Exception
     */
    @PostMapping("menu")
    Response createMenu();

    /**
     * 更新菜单
     *
     * @return
     * @throws Exception
     */
    @PutMapping("menu")
    Response updateMenu();

    /**
     * 删除菜单
     *
     * @return
     * @throws Exception
     */
    @DeleteMapping("/menu")
    Response deleteMenu(@Param("id") Long id);

    /**
     * 门户权限-菜单分组下的菜单列表
     * @param req 菜单分组id
     * @return 菜单集合
     */
    @PostMapping("/underGroup/menuList")
    Response<List<MenuInfo>> underGroupMenuList(@RequestBody MenuListREQ req);

    /**
     * 门户权限-菜单分组下新增菜单
     * @param req
     * @return
     */
    @PostMapping("/underGroup/menuAdd")
    Response underGroupMenuAdd(@RequestBody UnderGroupMenuAddREQ req);


    /**
     * 门户权限-菜单编辑
     * @param req 菜单
     * @return
     */
    @PostMapping("/underGroup/menuUpdate")
    Response underGroupMenuUpdate(@RequestBody UnderGroupMenuUpdateREQ req);

    /**
     * 门户权限-菜单删除
     * @param req
     * @return
     */
    @PostMapping("underGroup/menuDel")
    Response underGroupMenuDel(@RequestBody UnderGroupMenuDelREQ req);


    /**
     * 门户权限-门户菜单
     * @return
     */
    @PostMapping("gruul/menu")
    Response<List<GruulMenu>> gruulMenuList();


}
